package com.example.mobile2021606163crw0427;

import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private EditText editTextTextPersonName;
    private Button button;
    private RecyclerView rvMainTitle;
    private List<Tcc> list = new ArrayList();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        rvMainTitle.setLayoutManager(new LinearLayoutManager(this));
//      设置适配器
        rvMainTitle.setAdapter(new TccRVAdapter(list));
        list.add(new Tcc(R.drawable.tcc1,"国际大厦停车场","空位：30","价格：5元/小时","距离：20公里","地址：佛山市高明区富湾镇学府路2号"));
        list.add(new Tcc(R.drawable.tcc2,"国际大厦停车场","空位：40","价格：6元/小时","距离：21公里","地址：佛山市高明区富湾镇学府路3号"));
        list.add(new Tcc(R.drawable.tcc3,"国际大厦停车场","空位：50","价格：7元/小时","距离：22公里","地址：佛山市高明区富湾镇学府路4号"));
        list.add(new Tcc(R.drawable.tcc4,"国际大厦停车场","空位：60","价格：8元/小时","距离：23公里","地址：佛山市高明区富湾镇学府路5号"));
        list.add(new Tcc(R.drawable.tcc5,"国际大厦停车场","空位：70","价格：9元/小时","距离：24公里","地址：佛山市高明区富湾镇学府路6号"));
    }

    private void initView() {
        editTextTextPersonName = (EditText) findViewById(R.id.editTextTextPersonName);
        button = (Button) findViewById(R.id.button);
        rvMainTitle = (RecyclerView) findViewById(R.id.rv_main_title);
    }
}